import { DataSourceInfoVO } from '@/api/tenant/data-source-info/types';
import request from '@/utils/axios';

import { TenantInfoListRS, TenantInfoVO } from './types';

export const listApi = (data: any) => {
  return request.post<TenantInfoListRS>({
    url: '/tenant/tenantInfo/list',
    data,
  });
};

export const getApi = (id: string) => {
  return request.get<TenantInfoVO>({ url: '/tenant/tenantInfo/get/' + id });
};

export const saveApi = (data: TenantInfoVO) => {
  return request.post({ url: '/tenant/tenantInfo/save', data });
};

export const updateApi = (data: TenantInfoVO) => {
  return request.post({ url: '/tenant/tenantInfo/update', data });
};

export const removeApi = (id?: string) => {
  return request.post({ url: '/tenant/tenantInfo/remove', params: { id } });
};

export const listAllDataSourceInfoApi = () => {
  return request.get<DataSourceInfoVO[]>({
    url: '/tenant/tenantInfo/listAllDataSourceInfo',
  });
};
